package com.yanqu.road.server.cmd.manor;

import com.yanqu.road.pb.manor.ManorProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.manor.ManorModule;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.ClientProtocol;
import com.yanqu.road.server.protocol.GameProtocol;

/**
 * @author ：zfr
 * @date ：2021/5/28 19:17
 */
@Cmd(code = GameProtocol.S_MANOR_GET_NPC_TALK_REWARD, desc = "庄园对话事件领奖")
public class ManorGetNpcTalkRewardCmd extends AbstractCommand {
    private ManorProto.GetManorTalkRewardRespMsg.Builder respMsg = ManorProto.GetManorTalkRewardRespMsg.newBuilder();
    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
        player.getModule(ManorModule.class).getNpcTalkReward(respMsg);
    }

    @Override
    public void sendData(GamePlayer player) {
        player.sendPacket(ClientProtocol.U_MANOR_GET_NPC_TALK_REWARD, respMsg);
    }
}
